#ifndef _ALLOCATOR_H_
#define _ALLOCATOR_H_

/*
	class : Allocator
	desc : The point of this class is to create an
	allocator that would allow a person to choose where they would
	allocate memory and save it and take care of all of the needed
	overhead when using it as a memory source. The main idea here
	is to think of the allocator of providing the needed additional
	functionality to extend the size of both the stack and heap by using
	any additional plugged in memory regardless of the interface to
	said memory. The allocator would hide the interface but ensure
	that memory is allocated as designed in theory. Well hopefully
	it should but that would depend on how you decide to implement it.
*/
class Allocator
{
	public:
		/*
			This will return the remaining space in the device
			that can be used
		*/
		virtual unsigned long int remainingSpace()=0;
		/*
			This will save the inputted data and return
			the address where it is saved. The address returned
			will act as a pointer for the device itself.
		*/
		virtual unsigned long int save(void* data, 
						unsigned long int size)=0;
		
		/*
			This will load the data into the given buffer from
			the memory the allocator is handling.
			It will use the given address and load as much data 
			as there is space in the buffer.
		*/
		virtual void load(void* buffer, unsigned long int size,
					unsigned long int address)=0;

		/*
			This function will look for and allocate free space
			of a given size in the memory it handles when it has
			finished scanning the memory and allocated free space
			it will return a start address to the memory allocated.
		*/
		virtual unsigned long int allocate(unsigned long int size)=0;
		/*
			frees allocated memory at the address
		*/
		virtual unsigned long int unallocate(unsigned long int addr)=0;
};

#endif
